package apps.AfterDlcs.afterDlcsBL;


import apps.AfterDlcs.afterDlcsBL.world.World;
import backs.JSONChater.MyJSONSend;

public class AfterDlcsThread extends Thread {
    public static boolean needKill = false;
    public static boolean stop=false;
    public void run()
    {
        while(!needKill)
        {
            try
            {
                while (stop) { Thread.sleep(1000);}
                for(int key:World.worldMap.keySet())
                {
                    World world=World.worldMap.get(key);
                    world.timePass();
                }
                Thread.sleep(100);
            }
            catch (Exception e)
            {
                MyJSONSend.sendToMe(this.getClass().getName()+":"+e.getMessage());
            }
        }
    }

    public void kill()
    {
        this.needKill=true;
    }

}
